<div id="pager">
  <ul id="forward-back">
    <li><?php echo link_to_unless($posts->getPreviousPage() == $posts->getPage(), '&larr; Назад', $sf_data->getRaw('route').$posts->getPreviousPage()) ?></li>
    <li><?php echo link_to_unless($posts->getNextPage() == $posts->getPage(),'Вперед &rarr;', $sf_data->getRaw('route').$posts->getNextPage()) ?></li>
  </ul>
  <ul id="number-page">
    <?php foreach ($posts->getLinks() as $page): ?>
        <li><?php echo link_to_unless($page == $posts->getPage(), $page, $sf_data->getRaw('route').$page) ?></li>
    <?php endforeach; ?>
  </ul>
</div>